{% extends "contifyuser/view_profile.html" %}

{% block user_profile_calendar %}{% endblock %}

{% block extrajs %}
    <script src="/{{ media_url }}contifyuser/js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function(){$("a.delGroup").click(function(){
            var gwebaddr = $(this).attr('gwebaddr');
            
            var isDelete=confirm("Are you sure you want to delete this group?");
            if (isDelete)
                    jQuery.ajax({
                            url: '/connectpeople/home/',
                            type: 'POST',
                            data: {'action': 'Delete_Group', 'gwebaddr':gwebaddr},
                            dataType: 'json',
                            success: function(json){
                                    document.getElementById(gwebaddr).style.display="none";
                          },
                            error: function(xhr, ajaxOptions, thrownError){
                                    alert("An Error Has Occurred. Please try again.");
                            }
                          });
                    
            else
            {
                    alert("Aap achhe insaan ho. Khuda aapko bachhe de !! :)");
            }
            
            });
        });
        
	 $(document).ready(function(){$("input.postComment").click(function(e){
	    var comm_id = "#" + $(this).attr('activity_id');
            var comment_div = $(comm_id);
	    jQuery.ajax({
	      url: '/connectpeople/home/',
	      type: 'POST',
	      data: {'action': 'NEW_DISCUSSION_ACTIVITY_COMMENT_POSTED', 'comment': comment_div.val(), 'acti_id': $(this).attr('activity_id')},
	      dataType: 'json',
	      success: function(json){
		alert("success");
	    },
	      error: function(xhr, ajaxOptions, thrownError){
		alert("An Error Has Occurred. Please try again.");
	      }
	    });
	  });
	  });
         
        // Other Activity Ajax method
        $(document).ready(function(){$("a.other_act_like").click(function(e){
	    var comm_id = "#" + $(this).attr('activity_id');
            var comment_div = $(comm_id);
	    jQuery.ajax({
	      url: '/connectpeople/home/',
	      type: 'POST',
	      data: {'action': 'NEW_DISCUSSION_ACTIVITY_LIKED', 'type': 'LIKE', 'value': 1, 'index': $(this).attr('id')},
	      dataType: 'json',
	      success: function(json){
		alert("success");
	    },
	      error: function(xhr, ajaxOptions, thrownError){
		alert("An Error Has Occurred. Please try again.");
	      }
	    });
	  });
	  });        
        
    </script>
{% endblock %}



